# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-pytest-raises
pkgver=0.11
pkgrel=4
pkgdesc='An implementation of pytest.raises as a pytest.mark fixture'
arch=('any')
license=('MIT')
url='https://github.com/Lemmons/pytest-raises'
depends=('python-pytest')
makedepends=('python-setuptools')
source=("https://github.com/Lemmons/pytest-raises/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('d4df7012941bd06d090fc26018a516c10329d96ba80f69ea9794cb17f632240a4747067cc146dd04c9c9a666a1e7be0458ccf1eb7c74b4bf6e2b73daa56f80ec')

build() {
  cd pytest-raises-$pkgver
  python setup.py build
}

check() {
  # Hack entry points by installing it

  local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
  cd pytest-raises-$pkgver
  python setup.py install --root="$PWD/tmp_install" --optimize=1
  PYTHONPATH="$PWD/tmp_install$site_packages:$PYTHONPATH" pytest
}

package() {
  cd pytest-raises-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}

# vim:set ts=2 sw=2 et:
